import React from 'react';
import Bread from '../../component/TableContent/VipBread';
import { Breadcrumb, Table} from 'antd';
import axios from '../../utils/http'
//结算管理
const columns = [
  {
    title: 'ID',
    dataIndex: 'setmgtId',
  },
  {
    title: '结算单号',
    dataIndex: 'setmgtSbcn',
  },
  {
    title: '姓名',
    dataIndex: 'setmgtAp',
  },
  {
    title: '结算金额',
    dataIndex: 'setmgtSa',
  },
  {
    title: '申请时间',
    dataIndex: 'setmgtAt',
  },
  {
    title: '状态',
    dataIndex: 'setmgtStatus',
  },
  {
    title: '操作',
    dataIndex: 'tags',
    render: tags => (
      <>
        {tags.map(tag => {
          return (//
            <a className='abtn' color='purple' key={tag} href='http://localhost:3000/#/Home/huiYuan/SetDetails'>
              {tag.toUpperCase()}
            </a>
          );
        })}
      </>
    ),
  },
];
// @withRouter
class SetManage extends React.Component {
  constructor() {
    super()
    this.state = {
      tableData: []
    }
  }
  shequ = () => {
    this.props.history.push('/Home/huiYuan/Partner')
  }
  addparter = () => {
    this.props.history.push('/Home/huiYuan/AddPartner')
  }
  jiesuan = () => {
    this.props.history.push('/Home/huiYuan/SetManage')
  }
render(){
return (
  <div>
    <Bread mianbao='社区合伙人'></Bread>
    <Breadcrumb>
      <Breadcrumb.Item onClick={this.shequ}>社区合伙人管理</Breadcrumb.Item>
      <Breadcrumb.Item onClick={this.addparter}>添加社区合伙人</Breadcrumb.Item>
      <Breadcrumb.Item onClick={this.jiesuan}>结算管理</Breadcrumb.Item>
    </Breadcrumb>
    <div className='wrapper'>
      <Table style={{marginTop:'5rem'}} columns={columns} dataSource={this.state.tableData}/>
    </div>
  </div>
);
  }
  componentDidMount() {
    axios({
      url: '/member/querySetMgt',
      method: 'get',
    }).then(({ data }) => {
      for (let i = 0; i < data.data.length; i++){
        data.data[i].key=i
        data.data[i].tags=['查看']
      }
      this.setState({
        tableData:data.data
      })
      // console.log(this.state.tableData)
      console.log(data.data)
    })
  }
}
export default SetManage;